package name.wilbur.course.db.bigone.control;

import name.wilbur.course.db.bigone.model.User;
import name.wilbur.course.db.bigone.service.ILoginService;
import name.wilbur.course.db.bigone.service.impl.LoginService;

public class LoginMgr extends BaseMgr {
	private ILoginService loginServ;
	
	public LoginMgr() {
		loginServ = new LoginService();
	}
	
	public User login(String name, String password) {
		User me = loginServ.findMe(name);
		if (!loginServ.isValidUser(me, password))
			return null;
		setMe(me);
		return me;
	}
}
